"""
Desktop UI theme definitions and simple styling helpers for Kivy widgets.
"""

from kivy.metrics import dp

# Color palette (RGBA)
PRIMARY = (0.20, 0.60, 0.90, 1)
ACCENT = (0.20, 0.70, 0.30, 1)
DANGER = (0.80, 0.20, 0.20, 1)
WARNING = (0.95, 0.70, 0.20, 1)

BG = (0.08, 0.08, 0.08, 1)
CARD_BG = (0.12, 0.12, 0.12, 1)
MUTED_BG = (0.16, 0.16, 0.16, 1)

TEXT = (1, 1, 1, 1)
TEXT_MUTED = (0.75, 0.75, 0.75, 1)

# Typography
H1 = dp(48)
H2 = dp(32)
BODY = dp(18)

# Spacing
SPACING = dp(20)
PADDING = dp(24)

def style_button(btn, bg_color=PRIMARY, text_color=TEXT, height=dp(56)):
    """Apply a flat, modern style to a Kivy Button."""
    try:
        btn.background_normal = ''
        btn.background_color = bg_color
        btn.color = text_color
        btn.height = height
    except Exception:
        # Best-effort styling only
        pass